package com.geekgo.lucenepp.service;

import com.geekgo.lucenepp.model.Page;
import org.apache.lucene.search.Query;

import java.util.HashMap;
import java.util.List;

/**
 * lucene服务
 *
 * @author HeHaoyang
 * @create 2017-06-14 10:18
 **/
public interface LuceneService {

    boolean saveObj(Object obj);

    boolean saveObjs(List<Object> objs);

    boolean saveMaps(List<HashMap> objs);

    boolean updateObj(Object obj,String key,String value);

    boolean updateObjs(List<Object> objs,String key,String value);

    <T> List<T>  findList(String keyword, Class<T> clazz);

    <T> Page<T> findPageList(String keyword, int pageNumber, int pageSize, Class<T> clazz);

    <T> List<T> findRangeList(Query query, Class<T> clazz);

    <T> Page<T> findRangePageList(Query query, int pageNumber, int pageSize, Class<T> clazz);

    boolean delAll();
}
